//-----------------------------------------------------------------------
// <copyright file="Group.cs" company="Rhys Parry">
//    Copyright Rhys Parry 2009
//    This file is released under the Apache 2.0 License
// </copyright>
//-----------------------------------------------------------------------
namespace Smarts.Core.RegularExpressions
{
    using System.Collections.Generic;
    using System.Linq;
    using Stre = System.Text.RegularExpressions;

    public class Group : Capture
    {
        private Stre.Group group;

        protected Group(Stre.Group group) : base(group)
        {
            this.group = group;
        }

        public IEnumerable<Capture> Captures
        {
            get
            {
                return group.Captures.Cast<Capture>();
            }
        }

        public bool Success
        {
            get
            {
                return group.Success;
            }
        }

        public static implicit operator Stre.Group(Group group)
        {
            return group.group;
        }

        public static implicit operator Group(Stre.Group group)
        {
            return new Group(group);
        }
    }
}